package com.orifine.sql;

public class SyntaxString {
	private StringBuffer out = new StringBuffer();
	private boolean isStartLine = true;

	public SyntaxString append(String str) {
		if (isStartLine) {
			isStartLine = false;
		}
		out.append(str);
		return this;
	}

	public SyntaxString addWord(String word) {
		if (isStartLine) {
			isStartLine = false;
		} else {
			out.append(" ");
		}
		out.append(word);
		return this;
	}

	public SyntaxString line() {
		out.append('\n');
		isStartLine = true;
		return this;
	}
	
	public SyntaxString tabs(){
		out.append('\t');
		isStartLine = true;
		return this;
	}
	
	public SyntaxString blank(){
		out.append(' ');
		isStartLine = true;
		return this;
	}
	
	public String toString(){
		return out.toString();
	}
}
